package com.twu.biblioteca.data_structures;

import java.io.PrintStream;

public class User {
    private String username;
    private String password;
    private String name;
    private String phone;
    private String email;
    private PrintStream ps;

    public User(String username, String password, String name, String phone, String email){
         this(username, password, name, phone, email, System.out);
    }

    public User(String username, String password, String name, String phone, String email, PrintStream ps) {
        this.username = username;
        this.password = password;
        this.name = name;
        this.phone = phone;
        this.email = email;
        this.ps = ps;
    }

    public boolean loginSuccessful(String username, String password){
        if(this.username.equals(username) && this.password.equals(password))
            return true;
        return false;
    }

    public void print(){
        ps.println(name+ "|" + phone + "|" + email);
    }
}
